package io.gitee.hefren.hhcache.command;

import com.google.common.base.Strings;
import io.gitee.hefren.hhcache.core.*;

/**
 * @Date 2024/7/9
 * @Author lifei
 */
public class UnknownCommand implements Command {
    @Override
    public String name() {
        return CommandEnum.UNKNOWN.name();
    }

    @Override
    public Reply<?> exec(HhCache cache, String[] args) {
        String comName = getCom(args);
        String result = Strings.lenientFormat("Unknown command: %s", comName);
        return Reply.errorReply(result);
    }
}
